import React from 'react'
import { Switch, Route,Redirect } from "react-router-dom"
import Login from "./pages/Login/Login"
import Index from "./pages/Index/Index"
import Detail from "./pages/Detail/Detail"
import Search from "./pages/Search/Search"
import List from "./pages/List/List"
import Register from "./pages/Register/Register"
export default function App() {
  return (
    <div>
      {/* 配置路由出口 */}
      <Switch>
        {/* 一级路由规则 */}
        <Route path="/login" component={Login}></Route>
        <Route path="/index" component={Index}></Route>
        <Route path="/list" component={List}></Route>
        <Route path="/detail/:id" component={Detail}></Route>
        <Route path="/search" component={Search}></Route>
        <Route path="/register" component={Register}></Route>
        <Redirect to="/login"></Redirect>
      </Switch>
    </div>
  )
}